/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package DAO;

import DTO.CChuc_vu;
import java.sql.ResultSet;
import java.util.List;
import DTO.CFields;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Khang
 */
public class CChuc_VuDAO extends IData<CChuc_vu>{

    @Override
    public CChuc_vu add(CChuc_vu item) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void saveBatch() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public int addrows(List<CChuc_vu> list, SubConfig config) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public CChuc_vu Find(CChuc_vu item, List<CChuc_vu> list) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    protected Object OnSubmit(CChuc_vu item, int t, SubConfig config) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public Object insertOnSubmit(CChuc_vu item, SubConfig config) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public Object updateOnSubmint(CChuc_vu item, SubConfig config) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public Object deleteOnSubmint(CChuc_vu item, SubConfig config) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    protected CChuc_vu getItem(ResultSet rs) {
        CChuc_vu item = new CChuc_vu();
        try {
            item.setId(rs.getLong(CFields.id));
            item.setTenChucVu(rs.getString(CFields.ten_chuc_vu));
        } catch (SQLException ex) {
            Logger.getLogger(CChuc_VuDAO.class.getName()).log(Level.SEVERE, null, ex);
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        }        
        //
        return item;
    }

    @Override
    public List<CChuc_vu> getAll(SubConfig config) {
       // throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        String mysql = "select * from " + CFields.tb_chuc_vu + " " + this.sWhere;
        return this.getAll(mysql, config);
    }

    @Override
    protected void add(CChuc_vu item, int t) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

   
    
}
